﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Restaurant
{
    public partial class frmDoanhThu : Form
    {
        int flag = 1;
        public frmDoanhThu()
        {
            InitializeComponent();
        }



        private void btnThongTin_Click(object sender, EventArgs e)
        {
            if (flag == 1)
            {
                flag = 0;
                grbDoanhThu.Visible = true;
                return;
            }
            if(flag == 0)
            {
                flag = 1;
                grbDoanhThu.Visible = false;
                return;
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void frmDoanhThu_Load(object sender, EventArgs e)
        {
            grbDoanhThu.Visible = false;
        }

        private void btnInDoanhThu_Click(object sender, EventArgs e)
        {
            frmChiTietDoanhThu _frmCTDT = new frmChiTietDoanhThu();
            _frmCTDT.Show();
        }

        private void btnSuaDoanhThu_Click(object sender, EventArgs e)
        {

        }

        private void btnChiTiet_Click(object sender, EventArgs e)
        {
            
            int maNH = int.Parse(lvDoanhThu.FocusedItem.SubItems["MaNH"].ToString());
            DateTime Ngay = DateTime.Parse(lvDoanhThu.FocusedItem.SubItems["Ngay"].ToString());
            frmChiTietDoanhThu  ctdt = new frmChiTietDoanhThu(maNH,Ngay);
            ctdt.Show();

        }

    }
}
